﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Controls_admin_ucMain_Home : System.Web.UI.UserControl
{
    BUS_Category category = new BUS_Category();
   // BUS_Maker maker = new BUS_Maker();
    Bus_Users user = new Bus_Users();
    //BUS_Customers customer = new BUS_Customers();
    //BUS_Order order = new BUS_Order();
    //BUS_Product product = new BUS_Product();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }
    }

    protected void LoadData()
    {
        try
        {
            DataTable dtC = new DataTable();
            DataTable dtM = new DataTable();
            DataTable dtU = new DataTable();
            DataTable dtCT = new DataTable();
            DataTable dtP = new DataTable();
            DataTable dtO = new DataTable();
            dtC = category.Category_getAllData();
            //dtM = maker.Maker_getAllData();
            lLoaisanpham.Text = dtC.Rows.Count.ToString();
            lNhsanxuat.Text = dtM.Rows.Count.ToString();
            //dtM = maker.Maker_getByStatus(0);
            lDongSP2.Text = dtM.Rows.Count.ToString();
            //dtM = maker.Maker_getByStatus(1);
            lMoSP2.Text = dtM.Rows.Count.ToString();
            //dtP = product.Product_getByWhere("");
            lSanpham1.Text = dtP.Rows.Count.ToString();
            //dtP = product.Product_getByWhere("WHERE Status = 0");
            lDongSP1.Text = dtP.Rows.Count.ToString();
            //dtP = product.Product_getByWhere("WHERE Status = 1");
            lMoSP1.Text = dtP.Rows.Count.ToString();
            dtU = user.Users_getAllData();
            lQuanly.Text = dtU.Rows.Count.ToString();
            dtU = user.Users_getByStatus(0);
            lDongND1.Text = dtU.Rows.Count.ToString();
            dtU = user.Users_getByStatus(1);
            lMoND1.Text = dtU.Rows.Count.ToString();
            //dtCT = customer.Customers_getAllData();
            lKhachhang.Text = dtCT.Rows.Count.ToString();
            //dtCT = customer.Customers_getData("Status = 0");
            lDongND2.Text = dtCT.Rows.Count.ToString();
            //dtCT = customer.Customers_getData("Status = 1");
            lMoND2.Text = dtCT.Rows.Count.ToString();
            //dtO = order.Order_getData(0,1);
            lDDHChuaxuly.Text = dtO.Rows.Count.ToString();
            //dtO = order.Order_getData(1, 4);
            lDDHDagiaohang.Text = dtO.Rows.Count.ToString();
        }
        catch
        {
        }
        
    }
}